<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker,autocomplete"></t:base>
<div class="easyui-layout" fit="true">
    <div region="center" style="padding:0px;border:0px">
        <t:datagrid name="l0" pagination="true"  title=""  fitColumns="false" onLoadSuccess="doload"  onClick="onselect"  actionUrl="sjxypzController.do?sublistDatagrid" idField="id" fit="true" >
            <t:dgCol title="id"  field="id"   hidden="true"    width="120"></t:dgCol>
            <t:dgCol title="传输数据名称"  field="fd_data"    width="100"></t:dgCol>
            <t:dgCol title="上传类型"  field="fd_outtype"    width="100"></t:dgCol>
            <t:dgCol title="上传名称"  field="fd_outname"    width="100"></t:dgCol>
            <t:dgCol title="数据分割符"  field="fd_split"    width="100"></t:dgCol>
          <%--  <t:dgCol title="最大数据量"  field="fd_max"    width="100"></t:dgCol>--%>
             <t:dgCol title="取数规则"  field="fd_rule"    width="100"></t:dgCol>
            
            <t:dgCol title="操作" field="opt" width="60"></t:dgCol>
            <t:dgDelOpt title="删除" url="sjxypzController.do?dodel&p=0&id={id}" urlclass="ace_button"  urlfont="fa-trash-o"/>
            <t:dgToolBar title="录入" icon="icon-add" url="sjxypzController.do?edit&p=0" funname="add" width="770" height="500"></t:dgToolBar>
            <t:dgToolBar title="编辑" icon="icon-edit" url="sjxypzController.do?edit&p=0" funname="update" width="770"></t:dgToolBar>
        </t:datagrid>
    </div>
</div>
<script type="text/javascript">
    function onselect(rowData) {
        var selected = $('#l0').datagrid('getSelected');
        window.parent.twotableid = selected.id;
    }
    function doload(rowData){
        var selected = $('#l0').datagrid('getSelected');
        if(selected) {
            var ntotlength = rowData.rows.length;
            if(ntotlength < 1) {
                window.parent.twotableid = "";
            }
        } else {
            var ntotlength = rowData.rows.length;
            if(ntotlength > 0) {
                $('#l0').datagrid('selectRow',0);
                var selected = $('#l0').datagrid('getSelected');
                window.parent.twotableid = selected.id;
                
            } else {

                window.parent.twotableid = "";

            }
        }
    }
</script>